<!DOCTYPE html>
<html lang="zh_cn">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">	<meta name="csrf-token" content="<?php echo e(csrf_token()); ?>">
    <title><?php echo e($config['title']); ?></title>
    <link rel="stylesheet" href="<?php echo config('admin.admin_url'); ?>/plugins/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="<?php echo config('admin.admin_url'); ?>/admin/css/login.css" />
    <link rel="stylesheet" href="<?php echo config('admin.admin_url'); ?>/common/css/font.css" />
</head>
<body class="beg-login-bg">
<div class="container login">
    <div class="content">
        <div id="large-header" class="large-header" style="background-image: url(<?php echo e($config['image_one']['url']); ?>)">
            <canvas id="demo-canvas"></canvas>
            <div class="main-title">
                <div class="beg-login-box">
                    <header>
                        <h1><?php echo e($config['title']); ?></h1>
                    </header>
                    <div class="beg-login-main">
                        <form class="layui-form layui-form-pane" lay-filter="form">
                            <div class="layui-form-item">
                                <label class="beg-login-icon fs1">
                                    <span class="icon icon-user"></span>
                                </label>
                                <input type="text" name="username" lay-verify="required" placeholder="这里输入登录名" value="" class="layui-input">
                            </div>
                            <div class="layui-form-item">
                                <label class="beg-login-icon fs1">
                                    <i class="icon icon-key"></i>
                                </label>
                                <input type="password" name="password" lay-verify="required" placeholder="这里输入密码" value="" class="layui-input">
                            </div>
                            <div class="layui-form-item">
                                <button class="layui-btn btn-submit btn-blog" type="button"  lay-submit="" lay-filter="submit">登录</button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="<?php echo config('admin.admin_url'); ?>/admin/js/rAF.js"></script>
<script src="<?php echo config('admin.admin_url'); ?>/admin/js/login.js"></script>
<script type="text/javascript" src="<?php echo config('admin.admin_url'); ?>/plugins/layui/layui.js"></script>
<script>
    layui.use(['form', 'layer'], function () {        var form = layui.form,layer = layui.layer,$= layui.jquery;		$.ajaxSetup({				headers: {									'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')						}		});	
        form.on('submit(submit)', function(data){
            loading =layer.load(1, {shade: [0.1,'#fff'] });
			$.post("<?php echo e(route('admin.login.login')); ?>",data.field,function(res){
                layer.close(loading);				console.log(res);
                if(res.status == 1){
                    layer.msg(res.msg, {icon: 1, time: 1000}, function(){
                        location.href = res.url;
                    });
                }else{
                    layer.msg(res.error, {icon: 2, anim: 6, time: 1000});
                }
            });
        });
    });
</script>
</body>
</html>